#ifndef SQLDB_CONGIG_H_
#define SQLDB_CONGIG_H_

#include "sqldb_utility.hpp"
using namespace std;
using sqldb::ResultSet;


//---------------------------
// throw
bool sqldb_init(const string& dbtype, const string& conn_url, const string& uname, const string& pswd, const string& init_paras = "");
bool sqldb_ping();
bool sqldb_load_config();

int64_t sqldb_insert(const string& dbname, const string& pl, const string& pd);
int64_t sqldb_delete(const string& dbname, const string& whereStmt);

int64_t sqldb_createtable(const string& dbname, const string& filed_list, bool exist = false);
int64_t sqldb_droptable(const string& dbname);

int64_t sqldb_update(const string& dbname, const string& set_list, const string& wherestmt);

shared_ptr<ResultSet> sqldb_select(const string& dbname, const string& wantparam, const string& wherestmt);
int64_t sqldb_select_insertid(const string& dbname, const string& pl, const string& pd);

//-------------------------------------------
void split(const string& src, const string& separator, vector<string>& dest);

#endif